package logic.characters;

import logic.enemies.Enemy;
import logic.pruebas.GamePanel;
import logic.threads.ShootFireBall;

public class Urahara extends Player{
	private static final long serialVersionUID = 8865995335988774236L;

	public Urahara(int x, int y, GamePanel panel, String nomImg, int salud, int attack, int defense, int magic, int resistance, int speed, int jump, int stamina, int[] abilitiesIDs ) {
		super(x, y, panel, nomImg, salud, attack, defense, magic, resistance, speed, jump, stamina, abilitiesIDs);
		specialCost = 5;
		shootCost = 2;
		staminaRecovery = 2;
		lifeRecovery = 1;
		widthDifference = 66;
		heightDifference = 0;
		collisionWidth = 40;
		collisionHeight = altura - heightDifference;
		attackTime = 1100;
		shootTime = 200;
		specialTime = 300;
	}

	@Override
	public void shoot() {
		Runnable shootFireBall = new ShootFireBall(collisionX, collisionY, panelJuego, lookingRight, enemies, blocks, magic, shootTime);
		Thread fThread = new Thread(shootFireBall);
		fThread.start();
		
	}

	@Override
	public void specialEffect(Enemy enemy) {
		//Nothing
	}
	
	public void special() {
		if (stamina >= specialCost) {
		if (!attacking && !jumping && !throwing) {
			if (!special) {
				stamina -= specialCost;
			}
			
		velX = 0;
		special = true;
		movementAllowed = false;
		if (lookingRight) {
				updateIcon("resources" + getClass().getSimpleName() + "/SR.gif");
				coorX += 150;
		} else {
				updateIcon("resources" + getClass().getSimpleName() + "/SL.gif");
				coorX -= 150;
		}
		lastActionTime = System.currentTimeMillis();
		dibujar();
		}
		}
	}

}
